package util;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;

public class DBSettings
{
	private String[] arr;

	public DBSettings()
	{
		Scanner sc = null;

		try
		{
			sc = new Scanner(new File("config/db-settings.txt"));
		}
		catch (FileNotFoundException e)
		{
			e.printStackTrace();
		}

		ArrayList<String> lines = new ArrayList<String>();
		while (sc.hasNextLine())
			lines.add(sc.nextLine());

		sc.close();

		arr = lines.toArray(new String[0]);
	}

	public String getDBSettingLine(int num)
	{
		return ((num > 0) && (num <= arr.length)) ? arr[num] : "";
	}
}